package com.nchu.student_score.controller;

import com.nchu.student_score.dataObject.User;
import com.nchu.student_score.service.UserService;
import com.nchu.student_score.vo.ResultVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    UserService userService;

    @RequestMapping("adminCheck")//用户登录信息校验
    public ResultVo<User> adminCheck(@RequestBody User user){
        return userService.adminCheck(user);
    }

    @RequestMapping("teacherCheck")
    public ResultVo<User> teacherCheck(@RequestBody User user){
        return userService.teacherCheck(user);
    }

    @RequestMapping("studentCheck")
    public ResultVo<User> studentCheck(@RequestBody User user){
        return userService.studentCheck(user);
    }

    @RequestMapping("adminChangePwd")
    public ResultVo<User> adminChangePwd(@RequestBody User user){
        return userService.adminChangePwd(user);
    }

    @RequestMapping("teacherChangePwd")
    public ResultVo<User> teacherChangePwd(@RequestBody User user){
        return userService.teacherChangePwd(user);
    }

    @RequestMapping("studentChangePwd")
    public ResultVo<User> studentChangePwd(@RequestBody User user){
        return userService.studentChangePwd(user);
    }
}
